/*
 * Copyright (C) 2014 Realtek Semiconductor Corp.
 * All Rights Reserved.
 *
 * This program is the proprietary software of Realtek Semiconductor
 * Corporation and/or its licensors, and only be used, duplicated,
 * modified or distributed under the authorized license from Realtek.
 *
 * ANY USE OF THE SOFTWARE OTHER THAN AS AUTHORIZED UNDER
 * THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
 *
 * Purpose : Definition of ME handler: PPTP POTS UNI (53)
 *
 * Feature : The file includes the following modules and sub-modules
 *           (1) ME handler: PPTP POTS UNI (53)
 */

#include "app_basic.h"


MIB_TABLE_INFO_T gMibMgcCfgDataTableInfo;
MIB_ATTR_INFO_T  gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_ATTR_NUM];
MIB_TABLE_MGCCFGDATA_T gMibMgcCfgDataDefRow;
MIB_TABLE_OPER_T gMibMgcCfgDataOper;

GOS_ERROR_CODE MgcCfgDataDrvCfg(void* pOldRow, void* pNewRow, MIB_OPERA_TYPE operationType, MIB_ATTRS_SET attrSet, UINT32 pri)
{
	//MIB_TABLE_INDEX     tableIndex = MIB_TABLE_MGCCFGDATA_INDEX;
	GOS_ERROR_CODE      ret = GOS_OK;
    //UINT16              chid;


    //omci_get_channel_index_by_pots_uni_me_id(pMibPotsUni->EntityId, &chid);

    OMCI_LOG(OMCI_LOG_LEVEL_DBG, "Start %s...", __FUNCTION__);

    switch (operationType)
    {
    case MIB_ADD:
    	OMCI_LOG(OMCI_LOG_LEVEL_DBG,"PotsUni --> ADD");
    	break;
    case MIB_SET:
    	OMCI_LOG(OMCI_LOG_LEVEL_DBG,"PotsUni --> SET");
    	break;
    case MIB_DEL:
    	OMCI_LOG(OMCI_LOG_LEVEL_DBG,"PotsUni --> DEL");
    	break;
    default:
        break;
    }

    return ret;
}

GOS_ERROR_CODE mibTable_init(MIB_TABLE_INDEX tableId)
{
    gMibMgcCfgDataTableInfo.Name = "MgcCfgData";
    gMibMgcCfgDataTableInfo.ShortName = "MGCCD";
    gMibMgcCfgDataTableInfo.Desc = "MGC config data";
    gMibMgcCfgDataTableInfo.ClassId = (UINT32)(OMCI_ME_CLASS_MGC_CFG_DATA);
    gMibMgcCfgDataTableInfo.InitType = (UINT32)(OMCI_ME_INIT_TYPE_OLT);
    gMibMgcCfgDataTableInfo.StdType = (UINT32)(OMCI_ME_TYPE_STANDARD);
    gMibMgcCfgDataTableInfo.ActionType = (UINT32)(OMCI_ME_ACTION_CREATE | OMCI_ME_ACTION_DELETE | OMCI_ME_ACTION_SET | OMCI_ME_ACTION_GET);
    gMibMgcCfgDataTableInfo.pAttributes = &(gMibMgcCfgDataAttrInfo[0]);

    gMibMgcCfgDataTableInfo.attrNum = MIB_TABLE_MGCCFGDATA_ATTR_NUM;
    gMibMgcCfgDataTableInfo.entrySize = sizeof(MIB_TABLE_MGCCFGDATA_T);
    gMibMgcCfgDataTableInfo.pDefaultRow = &gMibMgcCfgDataDefRow;

    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].Name = "EntityId";
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_PRIMARYMGC_INDEX - MIB_TABLE_FIRST_INDEX].Name = "PrimaryMGC";
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SECONDARYMGC_INDEX - MIB_TABLE_FIRST_INDEX].Name = "SecondaryMGC";
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_TCPUDPPTR_INDEX - MIB_TABLE_FIRST_INDEX].Name = "TcpUdpPtr";
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_VERSION_INDEX - MIB_TABLE_FIRST_INDEX].Name = "Version";
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXFMT_INDEX - MIB_TABLE_FIRST_INDEX].Name = "MaxFormat";
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXRETRYTIME_INDEX - MIB_TABLE_FIRST_INDEX].Name = "MaxRetryTime";
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXRETRYNUM_INDEX - MIB_TABLE_FIRST_INDEX].Name = "MaxRetryNum";
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SVCCHGDELAY_INDEX - MIB_TABLE_FIRST_INDEX].Name = "ServiceChangeDelay";
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_TERMIDBASE_INDEX - MIB_TABLE_FIRST_INDEX].Name = "TerminationIdBase";
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SOFTSW_INDEX - MIB_TABLE_FIRST_INDEX].Name = "SoftSwitch";
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MSGIDPTR_INDEX - MIB_TABLE_FIRST_INDEX].Name = "MessageIdPtr";

    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].Desc = "Entity ID";
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_PRIMARYMGC_INDEX - MIB_TABLE_FIRST_INDEX].Desc = "Primary MGC";
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SECONDARYMGC_INDEX - MIB_TABLE_FIRST_INDEX].Desc = "Secondary MGC";
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_TCPUDPPTR_INDEX - MIB_TABLE_FIRST_INDEX].Desc = "TCP/UDP pointer";
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_VERSION_INDEX - MIB_TABLE_FIRST_INDEX].Desc = "Version";
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXFMT_INDEX - MIB_TABLE_FIRST_INDEX].Desc = "Message format";
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXRETRYTIME_INDEX - MIB_TABLE_FIRST_INDEX].Desc = "Maximum retry time";
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXRETRYNUM_INDEX - MIB_TABLE_FIRST_INDEX].Desc = "Maximum retry attempts";
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SVCCHGDELAY_INDEX - MIB_TABLE_FIRST_INDEX].Desc = "Service change delay";
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_TERMIDBASE_INDEX - MIB_TABLE_FIRST_INDEX].Desc = "Termination ID base";
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SOFTSW_INDEX - MIB_TABLE_FIRST_INDEX].Desc = "Softswitch";
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MSGIDPTR_INDEX - MIB_TABLE_FIRST_INDEX].Desc = "Message ID pointer";

    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].DataType = MIB_ATTR_TYPE_UINT16;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_PRIMARYMGC_INDEX - MIB_TABLE_FIRST_INDEX].DataType = MIB_ATTR_TYPE_UINT16;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SECONDARYMGC_INDEX - MIB_TABLE_FIRST_INDEX].DataType = MIB_ATTR_TYPE_UINT16;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_TCPUDPPTR_INDEX - MIB_TABLE_FIRST_INDEX].DataType = MIB_ATTR_TYPE_UINT16;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_VERSION_INDEX - MIB_TABLE_FIRST_INDEX].DataType = MIB_ATTR_TYPE_UINT8;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXFMT_INDEX - MIB_TABLE_FIRST_INDEX].DataType = MIB_ATTR_TYPE_UINT8;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXRETRYTIME_INDEX - MIB_TABLE_FIRST_INDEX].DataType = MIB_ATTR_TYPE_UINT16;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXRETRYNUM_INDEX - MIB_TABLE_FIRST_INDEX].DataType = MIB_ATTR_TYPE_UINT16;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SVCCHGDELAY_INDEX - MIB_TABLE_FIRST_INDEX].DataType = MIB_ATTR_TYPE_UINT16;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_TERMIDBASE_INDEX - MIB_TABLE_FIRST_INDEX].DataType = MIB_ATTR_TYPE_STR;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SOFTSW_INDEX - MIB_TABLE_FIRST_INDEX].DataType = MIB_ATTR_TYPE_UINT32;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MSGIDPTR_INDEX - MIB_TABLE_FIRST_INDEX].DataType = MIB_ATTR_TYPE_UINT16;

    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].Len = 2;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_PRIMARYMGC_INDEX - MIB_TABLE_FIRST_INDEX].Len = 2;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SECONDARYMGC_INDEX - MIB_TABLE_FIRST_INDEX].Len = 2;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_TCPUDPPTR_INDEX - MIB_TABLE_FIRST_INDEX].Len = 2;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_VERSION_INDEX - MIB_TABLE_FIRST_INDEX].Len = 1;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXFMT_INDEX - MIB_TABLE_FIRST_INDEX].Len = 1;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXRETRYTIME_INDEX - MIB_TABLE_FIRST_INDEX].Len = 2;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXRETRYNUM_INDEX - MIB_TABLE_FIRST_INDEX].Len = 2;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SVCCHGDELAY_INDEX - MIB_TABLE_FIRST_INDEX].Len = 2;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_TERMIDBASE_INDEX - MIB_TABLE_FIRST_INDEX].Len = 25;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SOFTSW_INDEX - MIB_TABLE_FIRST_INDEX].Len = 4;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MSGIDPTR_INDEX - MIB_TABLE_FIRST_INDEX].Len = 2;

    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].IsIndex = TRUE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_PRIMARYMGC_INDEX - MIB_TABLE_FIRST_INDEX].IsIndex = FALSE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SECONDARYMGC_INDEX - MIB_TABLE_FIRST_INDEX].IsIndex = FALSE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_TCPUDPPTR_INDEX - MIB_TABLE_FIRST_INDEX].IsIndex = FALSE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_VERSION_INDEX - MIB_TABLE_FIRST_INDEX].IsIndex = FALSE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXFMT_INDEX - MIB_TABLE_FIRST_INDEX].IsIndex = FALSE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXRETRYTIME_INDEX - MIB_TABLE_FIRST_INDEX].IsIndex = FALSE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXRETRYNUM_INDEX - MIB_TABLE_FIRST_INDEX].IsIndex = FALSE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SVCCHGDELAY_INDEX - MIB_TABLE_FIRST_INDEX].IsIndex = FALSE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_TERMIDBASE_INDEX - MIB_TABLE_FIRST_INDEX].IsIndex = FALSE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SOFTSW_INDEX - MIB_TABLE_FIRST_INDEX].IsIndex = FALSE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MSGIDPTR_INDEX - MIB_TABLE_FIRST_INDEX].IsIndex = FALSE;

    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].MibSave = TRUE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_PRIMARYMGC_INDEX - MIB_TABLE_FIRST_INDEX].MibSave = TRUE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SECONDARYMGC_INDEX - MIB_TABLE_FIRST_INDEX].MibSave = TRUE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_TCPUDPPTR_INDEX - MIB_TABLE_FIRST_INDEX].MibSave = TRUE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_VERSION_INDEX - MIB_TABLE_FIRST_INDEX].MibSave = TRUE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXFMT_INDEX - MIB_TABLE_FIRST_INDEX].MibSave = TRUE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXRETRYTIME_INDEX - MIB_TABLE_FIRST_INDEX].MibSave = TRUE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXRETRYNUM_INDEX - MIB_TABLE_FIRST_INDEX].MibSave = TRUE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SVCCHGDELAY_INDEX - MIB_TABLE_FIRST_INDEX].MibSave = TRUE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_TERMIDBASE_INDEX - MIB_TABLE_FIRST_INDEX].MibSave = TRUE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SOFTSW_INDEX - MIB_TABLE_FIRST_INDEX].MibSave = TRUE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MSGIDPTR_INDEX - MIB_TABLE_FIRST_INDEX].MibSave = TRUE;

    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].OutStyle = MIB_ATTR_OUT_HEX;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_PRIMARYMGC_INDEX - MIB_TABLE_FIRST_INDEX].OutStyle = MIB_ATTR_OUT_HEX;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SECONDARYMGC_INDEX - MIB_TABLE_FIRST_INDEX].OutStyle = MIB_ATTR_OUT_HEX;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_TCPUDPPTR_INDEX - MIB_TABLE_FIRST_INDEX].OutStyle = MIB_ATTR_OUT_HEX;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_VERSION_INDEX - MIB_TABLE_FIRST_INDEX].OutStyle = MIB_ATTR_OUT_DEC;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXFMT_INDEX - MIB_TABLE_FIRST_INDEX].OutStyle = MIB_ATTR_OUT_DEC;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXRETRYTIME_INDEX - MIB_TABLE_FIRST_INDEX].OutStyle = MIB_ATTR_OUT_DEC;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXRETRYNUM_INDEX - MIB_TABLE_FIRST_INDEX].OutStyle = MIB_ATTR_OUT_DEC;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SVCCHGDELAY_INDEX - MIB_TABLE_FIRST_INDEX].OutStyle = MIB_ATTR_OUT_DEC;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_TERMIDBASE_INDEX - MIB_TABLE_FIRST_INDEX].OutStyle = MIB_ATTR_OUT_CHAR;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SOFTSW_INDEX - MIB_TABLE_FIRST_INDEX].OutStyle = MIB_ATTR_OUT_CHAR;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MSGIDPTR_INDEX - MIB_TABLE_FIRST_INDEX].OutStyle = MIB_ATTR_OUT_HEX;

    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].OltAcc = OMCI_ME_ATTR_ACCESS_READ;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_PRIMARYMGC_INDEX - MIB_TABLE_FIRST_INDEX].OltAcc = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE | OMCI_ME_ATTR_ACCESS_SBC;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SECONDARYMGC_INDEX - MIB_TABLE_FIRST_INDEX].OltAcc = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE | OMCI_ME_ATTR_ACCESS_SBC;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_TCPUDPPTR_INDEX - MIB_TABLE_FIRST_INDEX].OltAcc = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE | OMCI_ME_ATTR_ACCESS_SBC;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_VERSION_INDEX - MIB_TABLE_FIRST_INDEX].OltAcc = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE | OMCI_ME_ATTR_ACCESS_SBC;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXFMT_INDEX - MIB_TABLE_FIRST_INDEX].OltAcc = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE | OMCI_ME_ATTR_ACCESS_SBC;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXRETRYTIME_INDEX - MIB_TABLE_FIRST_INDEX].OltAcc = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXRETRYNUM_INDEX - MIB_TABLE_FIRST_INDEX].OltAcc = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE | OMCI_ME_ATTR_ACCESS_SBC;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SVCCHGDELAY_INDEX - MIB_TABLE_FIRST_INDEX].OltAcc = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_TERMIDBASE_INDEX - MIB_TABLE_FIRST_INDEX].OltAcc = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SOFTSW_INDEX - MIB_TABLE_FIRST_INDEX].OltAcc = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE | OMCI_ME_ATTR_ACCESS_SBC;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MSGIDPTR_INDEX - MIB_TABLE_FIRST_INDEX].OltAcc = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE | OMCI_ME_ATTR_ACCESS_SBC;

    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].AvcFlag = FALSE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_PRIMARYMGC_INDEX - MIB_TABLE_FIRST_INDEX].AvcFlag = FALSE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SECONDARYMGC_INDEX - MIB_TABLE_FIRST_INDEX].AvcFlag = FALSE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_TCPUDPPTR_INDEX - MIB_TABLE_FIRST_INDEX].AvcFlag = FALSE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_VERSION_INDEX - MIB_TABLE_FIRST_INDEX].AvcFlag = FALSE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXFMT_INDEX - MIB_TABLE_FIRST_INDEX].AvcFlag = FALSE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXRETRYTIME_INDEX - MIB_TABLE_FIRST_INDEX].AvcFlag = FALSE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXRETRYNUM_INDEX - MIB_TABLE_FIRST_INDEX].AvcFlag = FALSE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SVCCHGDELAY_INDEX - MIB_TABLE_FIRST_INDEX].AvcFlag = FALSE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_TERMIDBASE_INDEX - MIB_TABLE_FIRST_INDEX].AvcFlag = FALSE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SOFTSW_INDEX - MIB_TABLE_FIRST_INDEX].AvcFlag = FALSE;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MSGIDPTR_INDEX - MIB_TABLE_FIRST_INDEX].AvcFlag = FALSE;

    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_PRIMARYMGC_INDEX - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SECONDARYMGC_INDEX - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_TCPUDPPTR_INDEX - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_VERSION_INDEX - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXFMT_INDEX - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXRETRYTIME_INDEX - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_OPTIONAL;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MAXRETRYNUM_INDEX - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_OPTIONAL;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SVCCHGDELAY_INDEX - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_OPTIONAL;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_TERMIDBASE_INDEX - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_OPTIONAL;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_SOFTSW_INDEX - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibMgcCfgDataAttrInfo[MIB_TABLE_MGCCFGDATA_MSGIDPTR_INDEX - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_OPTIONAL;

    memset(&gMibMgcCfgDataDefRow, 0, sizeof(MIB_TABLE_MGCCFGDATA_T));
    memset(gMibMgcCfgDataDefRow.TerminationIdBase, '\0', MIB_TABLE_MGCCFGDATA_TERMINATION_ID_BASE_LEN);
    memset(&gMibMgcCfgDataDefRow.Softswitch, '\0', sizeof(gMibMgcCfgDataDefRow.Softswitch));

    memset(&gMibMgcCfgDataOper, 0x0, sizeof(MIB_TABLE_OPER_T));
    gMibMgcCfgDataOper.meOperDrvCfg = MgcCfgDataDrvCfg;
    gMibMgcCfgDataOper.meOperDump = omci_mib_oper_dump_default_handler;

    MIB_TABLE_MGCCFGDATA_INDEX =tableId;
    MIB_InfoRegister(tableId, &gMibMgcCfgDataTableInfo, &gMibMgcCfgDataOper);

    return GOS_OK;
}

